package com.yhy.server.exception;

import com.yhy.domain.vo.ErrorResult;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class ExceptionAdvice {

    @ExceptionHandler(NullPointerException.class)
    public ResponseEntity nullPointerExceptionHandler(Exception e){
        e.printStackTrace();
        return ResponseEntity.status(500).body(ErrorResult.error());
    }
}
